
_init:

;EasyPIC LCD Potentiometer.c,32 :: 		void init() {
;EasyPIC LCD Potentiometer.c,33 :: 		ANSEL  = 0x04;                            // Configure AN2 pin as analog
	MOVLW      4
	MOVWF      ANSEL+0
;EasyPIC LCD Potentiometer.c,34 :: 		ANSELH = 0;                               // Configure other AN pins as digital I/O
	CLRF       ANSELH+0
;EasyPIC LCD Potentiometer.c,35 :: 		C1ON_bit = 0;                             // Disable comparators
	BCF        C1ON_bit+0, 7
;EasyPIC LCD Potentiometer.c,36 :: 		C2ON_bit = 0;
	BCF        C2ON_bit+0, 7
;EasyPIC LCD Potentiometer.c,39 :: 		SPI1_Init();                              // Initialize SPI module used with PortExpander
	CALL       _SPI1_Init+0
;EasyPIC LCD Potentiometer.c,40 :: 		SPI_Lcd_Config(0);                        // Initialize Lcd over SPI interface
	CLRF       FARG_SPI_Lcd_Config_DeviceAddress+0
	CALL       _SPI_Lcd_Config+0
;EasyPIC LCD Potentiometer.c,41 :: 		SPI_Lcd_Cmd(_LCD_CLEAR);                  // Clear display
	MOVLW      1
	MOVWF      FARG_SPI_Lcd_Cmd_out_char+0
	CALL       _SPI_Lcd_Cmd+0
;EasyPIC LCD Potentiometer.c,42 :: 		SPI_Lcd_Cmd(_LCD_CURSOR_OFF);             // Turn cursor off
	MOVLW      12
	MOVWF      FARG_SPI_Lcd_Cmd_out_char+0
	CALL       _SPI_Lcd_Cmd+0
;EasyPIC LCD Potentiometer.c,43 :: 		}
	RETURN
; end of _init

_main:

;EasyPIC LCD Potentiometer.c,45 :: 		void main() {
;EasyPIC LCD Potentiometer.c,46 :: 		init();
	CALL       _init+0
;EasyPIC LCD Potentiometer.c,47 :: 		while(1) {
L_main0:
;EasyPIC LCD Potentiometer.c,48 :: 		potentiometer_value = ADC_Read(2);      // Get 10-bit results of AD conversion
	MOVLW      2
	MOVWF      FARG_ADC_Read_channel+0
	CALL       _ADC_Read+0
	MOVF       R0+0, 0
	MOVWF      _potentiometer_value+0
	MOVF       R0+1, 0
	MOVWF      _potentiometer_value+1
	CLRF       _potentiometer_value+2
	CLRF       _potentiometer_value+3
;EasyPIC LCD Potentiometer.c,49 :: 		LongToStr(potentiometer_value,text);     // Convert Unsigned Int to Str
	MOVF       _potentiometer_value+0, 0
	MOVWF      FARG_LongToStr_input+0
	MOVF       _potentiometer_value+1, 0
	MOVWF      FARG_LongToStr_input+1
	MOVF       _potentiometer_value+2, 0
	MOVWF      FARG_LongToStr_input+2
	MOVF       _potentiometer_value+3, 0
	MOVWF      FARG_LongToStr_input+3
	MOVF       _text+0, 0
	MOVWF      FARG_LongToStr_output+0
	CALL       _LongToStr+0
;EasyPIC LCD Potentiometer.c,50 :: 		SPI_Lcd_Out(1,1, text);                 // Print text to Lcd, row 1, column 1
	MOVLW      1
	MOVWF      FARG_SPI_Lcd_Out_row+0
	MOVLW      1
	MOVWF      FARG_SPI_Lcd_Out_column+0
	MOVF       _text+0, 0
	MOVWF      FARG_SPI_Lcd_Out_text+0
	CALL       _SPI_Lcd_Out+0
;EasyPIC LCD Potentiometer.c,52 :: 		}
	GOTO       L_main0
;EasyPIC LCD Potentiometer.c,53 :: 		}
	GOTO       $+0
; end of _main
